<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		#div1 {width: 100px; height: 100px; padding: 10px; margin: 20px ; border: 1px solid #000 ; background-color: #45dfff; display: none;}
	</style>
	<script src="../jquery-1.10.1.min.js"></script>
	<script type="text/javascript">
	/*
		$()下的常用方法:
			text(): 获取所有的文本内容
	*/
	$(function() {
		// alert( $('div').html() );		//111<span>222</span>。获取所有的第一个

		// alert( $('div').text() );		//111222333

		// $('div').html('<h1>你好</h1>');			//赋值的话会解析标签

		$('div').text('<h1>你好</h1>');				//赋值的话不解析标签
	});
	</script>
</head>
<body>
	<div id="div1">111<span>222</span></div>
	<div>333</div>
</body>
</html>